﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using RestNews.Util.Security;
using RestNews.Data.Models;

namespace RestNews.Controllers
{
    /// <summary>
    /// Base class for all API controllers
    /// </summary>
    public class BaseApiController : ApiController
    {
        /// <summary>
        /// The current user
        /// </summary>
        public UserIdentity CurrentUser;

        /// <summary>
        /// The database context
        /// </summary>
        public RestNewsContext Db;

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseApiController"/> class.
        /// </summary>
        public BaseApiController()
        {
            CurrentUser = UserIdentity.CurrentUserIdentity;
            Db = new RestNewsContext();
        }
    }
}
